$(document).ready(function () {

    initSelect('#sltTaste',8);
    initSelect('#sltSize',1);
})


function initSelect(selector,typeId) {

    $.ajax({
        url: 'http://localhost:8080/dict/bySuperId?superId='+typeId,
        method: 'get',
        dataType: 'json',
        success: function (data) {

            $.each(data, function (index, item) {
                var opt = $('<option></option>').val(item.dict_id).text(item.title);
                $(selector).append(opt);
            })

        }
    })

}